* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.header p {
    color: #bdc3c7;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sidebar-header {
    background: #34495e;
    color: white;
    padding: 15px;
    font-weight: 600;
}

.file-list {
    max-height: 600px;
    overflow-y: auto;
}

.file-item {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-item.active {
    background: #3498db;
    color: white;
}

.file-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.file-icon.properties {
    background: #e74c3c;
    color: white;
}

.file-icon.yaml {
    background: #f39c12;
    color: white;
}

.content-area {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.content-header {
    background: #ecf0f1;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    opacity: 0.6;
    transform: none;
}

/* 可调整宽度的表格样式 */
.table-container {
    overflow-x: auto;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.config-table th,
.config-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    position: relative;
}

.config-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    user-select: none;
}

.config-table tr:hover {
    background: #f8f9fa;
}

/* 可调整列宽 */
.config-table th.resizable {
    position: relative;
}

.config-table th.resizable::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
}

.config-table th.resizable::after:hover {
    background: rgba(52, 152, 219, 0.3);
}

.config-table th.resizing::after {
    background: #3498db;
}

/* 列宽度 */
.col-key {
    width: 35%;
    min-width: 200px;
}

.col-value {
    width: 50%;
    min-width: 250px;
}

.col-action {
    width: 15%;
    min-width: 120px;
}

.config-key {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    color: #e74c3c;
    word-break: break-all;
    overflow-wrap: break-word;
}

.config-value {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    overflow-wrap: break-word;
}

.value-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    resize: vertical;
    min-height: 32px;
}

.value-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.value-display {
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

.value-display.readonly {
    color: #7f8c8d;
    font-style: italic;
    opacity: 0.8;
}

/* 配置项修改状态样式 */
.config-row.modified {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
}

.config-row.modified:hover {
    background-color: rgba(255, 193, 7, 0.15);
}

/* 缓存状态样式 */
.config-row.cached {
    background-color: rgba(52, 152, 219, 0.05);
    border-right: 3px solid #3498db;
}

.config-row.cached:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.config-row.cached.modified {
    background-color: rgba(255, 193, 7, 0.15);
    border-left: 3px solid #ffc107;
    border-right: 3px solid #3498db;
}

.modified-indicator {
    color: #ffc107;
    font-weight: bold;
    margin-right: 5px;
    cursor: help;
}

.cache-indicator-small {
    color: #3498db;
    font-weight: bold;
    margin-right: 5px;
    cursor: help;
    font-size: 12px;
}

.change-tooltip {
    position: relative;
    display: inline-block;
}

.change-tooltip .tooltip-content {
    visibility: hidden;
    width: 300px;
    background-color: #2c3e50;
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1002;
    top: 100%;
    left: 50%;
    margin-left: -150px;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.change-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-content .tooltip-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #ecf0f1;
}

.tooltip-content .tooltip-old {
    color: #e74c3c;
    margin-bottom: 5px;
}

.tooltip-content .tooltip-new {
    color: #27ae60;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.version-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
}

.version-item {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.version-item:last-child {
    border-bottom: none;
}

.version-info {
    flex: 1;
}

.version-number {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.version-comment {
    color: #7f8c8d;
    margin-bottom: 5px;
}

.version-time {
    font-size: 12px;
    color: #95a5a6;
}

/* 列宽调整提示 */
.resize-hint {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #34495e;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1002;
}

.resize-hint.show {
    opacity: 1;
}

.cache-indicator {
    color: #ffc107;
    font-weight: bold;
    margin-left: 10px;
    cursor: help;
}

/* 缓存状态警告条 */
.cache-warning {
    background: #ffc107;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.cache-warning-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cache-warning-icon {
    margin-right: 10px;
}

.cache-warning-text {
    flex: 1;
}

.cache-warning button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.cache-warning button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}